// Application

#include "FiveWin.ch"
#include "Folder.ch"

#ifdef __XPP__
   #define Super ::TWindow
#endif

//----------------------------------------------------------------------------//

function Application()

   local oWnd := TWndApp():New( "c:\Test\*.*" )

   oWnd:Activate()

return nil

//----------------------------------------------------------------------------//

CLASS TWndApp FROM TWindow

   DATA   oTabs

   METHOD New( cTitle ) CONSTRUCTOR

   METHOD ReSize( nType, nWidth, nHeight )

ENDCLASS

//----------------------------------------------------------------------------//

METHOD New( cTitle ) CLASS TWndApp

   local oBar, oFont
   local aFiles := Directory( cTitle, "D" )
   local n, aDirs := {}

   for n = 1 to Len( aFiles )
      if ! aFiles[ n ][ 1 ] $ ".."
         AAdd( aDirs, Lower( aFiles[ n ][ 1 ] ) )
      endif
   next

   Super:New(,,,, cTitle,,,, "Project",, "N/W" )

   DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -8

   DEFINE BUTTONBAR oBar _3D SIZE 33, 33 OF Self

   DEFINE BUTTON OF oBar
   DEFINE BUTTON OF oBar
   DEFINE BUTTON OF oBar

   @ 10, 0 TABS ::oTabs OF Self

   ::oTabs:SetTabs( ASort( aDirs ) )

return Self

//----------------------------------------------------------------------------//

METHOD ReSize( nType, nWidth, nHeight ) CLASS TWndApp

   local oRect

   Super:ReSize( nWidth, nHeight )

   oRect = ::GetCliRect()

   ::oTabs:Move( oRect:nBottom - 20, 0, nWidth + 1, 20, .t. )

return nil

//----------------------------------------------------------------------------//